Repository navigation
Conversation
A tool on the 2026-07-28 revision that asks for more input (for example a confirmation form) answers tools/call with an InputRequiredResult and runs on the client's retry. The SDK counted the round and the retry as two successful $mcp_tool_call events. - instrument(): a round sends $mcp_input_required with $mcp_tool_name, $mcp_duration_ms and $mcp_input_request_methods. Only the retry that completes the call is a $mcp_tool_call. The requests, answers and requestState are never captured. - A round returned to a client on an earlier revision, which mcp answers with an error, is a failed $mcp_tool_call with $mcp_error_type "input_required" instead of a successful one. - PostHogMCP.capture_input_required() for custom dispatchers. - The branch lives in ToolCallLifecycle.record_result, so every adapter gets it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A custom dispatcher had to check the result type itself and hardcode the methods it passed to capture_input_required(). prepare_tool_result() now sets PreparedToolResult.input_request_methods when the result is an input_required round, ordered by key, and leaves it None otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDK performance: posthog-pythonBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
💡 Motivation and Context
Changes
instrument()sends$mcp_input_requiredfor each round, as the spec defines and Go and Rust do. It carries the tool name, duration and request methods only.prepare_tool_result()returns the round'sinput_request_methods, andPostHogMCP.capture_input_required()records them.ToolCallLifecycle.record_result, which every adapter calls. mcp 1.x servers see no change.$mcp_tool_call$mcp_input_required$mcp_tool_call$mcp_tool_call$mcp_tool_call, success$mcp_tool_call,input_requirederrorExample event and custom dispatcher
{ "event": "$mcp_input_required", "properties": { "$mcp_tool_name": "delete_project", "$mcp_duration_ms": 3.2, "$mcp_input_request_methods": ["elicitation/create"], "$mcp_protocol_version": "2026-07-28", "$session_id": "ses_...", "$mcp_source": "posthog_mcp_analytics" } }💚 How did you test it?
resources/readandprompts/getrounds. Not run against a real MCP client.📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
claude-opus-5-5). Skills:debugging-mcp-analytics,writing-pr-descriptions.More context for AI agents
events.mdxtable.record_resultturns the 4 automatic-instrumentation tests red.🤖 Generated with Claude Code